home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1994-09-05 | 10.8 KB | [TEXT/CWIE] |
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
You can browse this item here: VideoTFB.c
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Mon Sep 5 23:45:01 1994, modified Mon Sep 5 23:45:01 1994, creator 'CWIE', type ASCII, 10322 bytes "VideoTFB.c" , at 0x28d2 428 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [CWIE] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 56 69 64 65 6f 54 | 46 42 2e 63 00 00 00 00 |..VideoT|FB.c....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 28 52 00 | 00 01 ac aa 91 96 3d aa |.....(R.|......=.|
|00000060| 91 96 3d 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..=.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 22 de 00 00 |........|...."...|
|00000080| 2f 2a 20 56 69 64 65 6f | 54 46 42 2e 63 0d 56 69 |/* Video|TFB.c.Vi|
|00000090| 64 65 6f 54 46 42 2e 63 | 20 61 6c 6c 6f 77 73 20 |deoTFB.c| allows |
|000000a0| 64 69 72 65 63 74 20 63 | 6f 6e 74 72 6f 6c 20 6f |direct c|ontrol o|
|000000b0| 66 20 74 68 65 20 6f 72 | 69 67 69 6e 61 6c 20 41 |f the or|iginal A|
|000000c0| 70 70 6c 65 20 63 6f 6c | 6f 72 20 76 69 64 65 6f |pple col|or video|
|000000d0| 20 63 61 72 64 73 2c 20 | 77 68 69 63 68 0d 61 72 | cards, |which.ar|
|000000e0| 65 20 6e 6f 20 6c 6f 6e | 67 65 72 20 73 6f 6c 64 |e no lon|ger sold|
|000000f0| 20 62 79 20 41 70 70 6c | 65 20 62 75 74 20 61 72 | by Appl|e but ar|
|00000100| 65 20 61 76 61 69 6c 61 | 62 6c 65 20 66 6f 72 20 |e availa|ble for |
|00000110| 24 39 30 20 66 72 6f 6d | 20 53 68 72 65 76 65 20 |$90 from| Shreve |
|00000120| 53 79 73 74 65 6d 73 0d | 28 38 30 30 2d 32 32 37 |Systems.|(800-227|
|00000130| 2d 33 39 37 31 29 2e 20 | 54 68 65 20 72 65 71 75 |-3971). |The requ|
|00000140| 69 72 65 64 20 76 69 64 | 65 6f 20 63 61 72 64 20 |ired vid|eo card |
|00000150| 66 6f 72 20 56 69 64 65 | 6f 54 46 42 20 69 73 20 |for Vide|oTFB is |
|00000160| 63 61 6c 6c 65 64 20 65 | 69 74 68 65 72 20 22 54 |called e|ither "T|
|00000170| 6f 62 79 0d 66 72 61 6d | 65 20 62 75 66 66 65 72 |oby.fram|e buffer|
|00000180| 20 63 61 72 64 22 20 6f | 72 20 22 4d 61 63 20 49 | card" o|r "Mac I|
|00000190| 49 20 48 69 67 68 2d 52 | 65 73 6f 6c 75 74 69 6f |I High-R|esolutio|
|000001a0| 6e 20 56 69 64 65 6f 20 | 43 61 72 64 22 2e 20 44 |n Video |Card". D|
|000001b0| 6f 6e d5 74 20 75 73 65 | 20 74 68 65 73 65 0d 72 |on.t use| these.r|
|000001c0| 6f 75 74 69 6e 65 73 20 | 75 6e 6c 65 73 73 20 79 |outines |unless y|
|000001d0| 6f 75 d5 72 65 20 70 72 | 65 70 61 72 65 64 20 74 |ou.re pr|epared t|
|000001e0| 6f 20 64 65 61 6c 20 77 | 69 74 68 20 74 68 65 20 |o deal w|ith the |
|000001f0| 72 65 73 75 6c 74 69 6e | 67 20 68 61 72 64 77 61 |resultin|g hardwa|
|00000200| 72 65 0d 64 65 70 65 6e | 64 65 6e 63 69 65 73 2e |re.depen|dencies.|
|00000210| 20 54 72 79 20 74 68 65 | 20 64 65 6d 6f 20 53 63 | Try the| demo Sc|
|00000220| 72 6f 6c 6c 44 65 6d 6f | 2e 0d 0d 4d 6f 73 74 20 |rollDemo|...Most |
|00000230| 70 65 6f 70 6c 65 20 73 | 68 6f 75 6c 64 20 73 6b |people s|hould sk|
|00000240| 69 70 20 74 68 69 73 20 | 66 69 6c 65 20 61 6e 64 |ip this |file and|
|00000250| 20 67 6f 20 74 6f 20 47 | 44 56 69 64 65 6f 2e 63 | go to G|DVideo.c|
|00000260| 20 69 6e 73 74 65 61 64 | 2c 20 73 69 6e 63 65 20 | instead|, since |
|00000270| 74 68 6f 73 65 0d 72 6f | 75 74 69 6e 65 73 20 77 |those.ro|utines w|
|00000280| 69 6c 6c 20 77 6f 72 6b | 20 77 69 74 68 20 41 4c |ill work| with AL|
|00000290| 4c 20 4d 61 63 20 76 69 | 64 65 6f 20 63 61 72 64 |L Mac vi|deo card|
|000002a0| 73 2e 0d 0d 54 46 42 20 | 73 74 61 6e 64 73 20 66 |s...TFB |stands f|
|000002b0| 6f 72 20 22 54 6f 62 79 | 20 46 61 72 72 61 6e 64 |or "Toby| Farrand|
|000002c0| 20 62 6f 61 72 64 22 2e | 20 54 6f 62 79 20 46 61 | board".| Toby Fa|
|000002d0| 72 72 61 6e 64 20 69 73 | 20 74 68 65 20 67 75 79 |rrand is| the guy|
|000002e0| 20 61 74 20 41 70 70 6c | 65 20 74 68 61 74 20 77 | at Appl|e that w|
|000002f0| 72 6f 74 65 0d 74 68 65 | 20 76 69 64 65 6f 20 64 |rote.the| video d|
|00000300| 72 69 76 65 72 20 66 6f | 72 20 74 68 69 73 20 63 |river fo|r this c|
|00000310| 61 72 64 2e 0d 0d 49 20 | 77 72 6f 74 65 20 74 68 |ard...I |wrote th|
|00000320| 69 73 20 62 61 73 65 64 | 20 6f 6e 20 6d 79 20 64 |is based| on my d|
|00000330| 69 73 61 73 73 65 6d 62 | 6c 79 20 6f 66 20 74 68 |isassemb|ly of th|
|00000340| 65 20 41 70 70 6c 65 20 | 76 69 64 65 6f 20 64 72 |e Apple |video dr|
|00000350| 69 76 65 72 20 61 6e 64 | 20 74 68 65 20 6d 65 6d |iver and| the mem|
|00000360| 6f 72 79 0d 64 69 61 67 | 6e 6f 73 74 69 63 73 20 |ory.diag|nostics |
|00000370| 49 20 72 65 63 65 69 76 | 65 64 20 66 72 6f 6d 20 |I receiv|ed from |
|00000380| 54 6f 62 79 20 46 61 72 | 72 61 6e 64 2e 0d 0d 48 |Toby Far|rand...H|
|00000390| 49 53 54 4f 52 59 3a 0d | 31 30 2f 32 39 2f 38 38 |ISTORY:.|10/29/88|
|000003a0| 09 64 67 70 09 77 72 6f | 74 65 20 69 74 0d 31 32 |.dgp.wro|te it.12|
|000003b0| 2f 35 2f 38 39 09 09 64 | 67 70 09 74 69 64 69 65 |/5/89..d|gp.tidie|
|000003c0| 64 20 69 74 20 75 70 20 | 61 20 62 69 74 2e 20 44 |d it up |a bit. D|
|000003d0| 65 6c 65 74 65 64 20 74 | 77 6f 20 6f 62 73 6f 6c |eleted t|wo obsol|
|000003e0| 65 74 65 20 72 6f 75 74 | 69 6e 65 73 2e 0d 33 2f |ete rout|ines..3/|
|000003f0| 32 30 2f 39 30 09 09 64 | 67 70 09 6d 61 6b 65 20 |20/90..d|gp.make |
|00000400| 63 6f 6d 70 61 74 69 62 | 6c 65 20 77 69 74 68 20 |compatib|le with |
|00000410| 4d 50 57 20 43 2e 0d 33 | 2f 32 33 2f 39 30 09 09 |MPW C..3|/23/90..|
|00000420| 64 67 70 20 69 6e 73 65 | 72 74 65 64 20 61 20 74 |dgp inse|rted a t|
|00000430| 65 73 74 20 69 6e 20 65 | 76 65 72 79 20 72 6f 75 |est in e|very rou|
|00000440| 74 69 6e 65 20 74 6f 20 | 65 78 69 74 20 75 6e 6c |tine to |exit unl|
|00000450| 65 73 73 20 69 74 27 73 | 20 61 20 54 46 42 20 63 |ess it's| a TFB c|
|00000460| 61 72 64 2e 0d 38 2f 32 | 34 2f 39 31 09 09 64 67 |ard..8/2|4/91..dg|
|00000470| 70 09 4d 61 64 65 20 63 | 6f 6d 70 61 74 69 62 6c |p.Made c|ompatibl|
|00000480| 65 20 77 69 74 68 20 54 | 48 49 4e 4b 20 43 20 35 |e with T|HINK C 5|
|00000490| 2e 30 2e 0d 31 32 2f 31 | 37 2f 39 32 09 64 67 70 |.0..12/1|7/92.dgp|
|000004a0| 20 61 64 64 65 64 20 63 | 61 63 68 65 20 74 6f 20 | added c|ache to |
|000004b0| 73 70 65 65 64 20 75 70 | 20 54 46 42 49 6e 53 6c |speed up| TFBInSl|
|000004c0| 6f 74 2e 0d 39 2f 35 2f | 39 34 20 64 67 70 20 72 |ot..9/5/|94 dgp r|
|000004d0| 65 6d 6f 76 65 64 20 61 | 73 73 75 6d 70 74 69 6f |emoved a|ssumptio|
|000004e0| 6e 20 69 6e 20 70 72 69 | 6e 74 66 27 73 20 74 68 |n in pri|ntf's th|
|000004f0| 61 74 20 69 6e 74 3d 3d | 73 68 6f 72 74 2e 0d 2a |at int==|short..*|
|00000500| 2f 0d 23 69 6e 63 6c 75 | 64 65 20 22 56 69 64 65 |/.#inclu|de "Vide|
|00000510| 6f 54 6f 6f 6c 62 6f 78 | 2e 68 22 0d 0d 2f 2a 20 |oToolbox|.h"../* |
|00000520| 54 68 65 20 43 61 72 64 | 42 61 73 65 20 61 64 64 |The Card|Base add|
|00000530| 72 65 73 73 20 64 65 70 | 65 6e 64 73 20 6f 6e 20 |ress dep|ends on |
|00000540| 77 68 69 63 68 20 73 6c | 6f 74 20 74 68 65 20 63 |which sl|ot the c|
|00000550| 61 72 64 20 69 73 20 70 | 6c 75 67 67 65 64 20 69 |ard is p|lugged i|
|00000560| 6e 74 6f 20 2a 2f 0d 2f | 2a 20 49 66 20 74 68 65 |nto */./|* If the|
|00000570| 20 63 61 72 64 20 69 73 | 20 70 6c 75 67 67 65 64 | card is| plugged|
|00000580| 20 69 6e 74 6f 20 74 68 | 65 20 66 69 72 73 74 20 | into th|e first |
|00000590| 73 6c 6f 74 2c 20 69 2e | 65 2e 20 73 6c 6f 74 20 |slot, i.|e. slot |
|000005a0| 39 2c 20 74 68 65 6e 20 | 2a 2f 0d 2f 2a 20 74 68 |9, then |*/./* th|
|000005b0| 65 20 61 64 64 72 65 73 | 73 20 69 73 20 30 78 46 |e addres|s is 0xF|
|000005c0| 39 39 30 30 30 30 30 2e | 20 54 68 65 20 73 6c 6f |9900000.| The slo|
|000005d0| 74 73 20 61 72 65 20 6e | 75 6d 62 65 72 65 64 20 |ts are n|umbered |
|000005e0| 39 20 74 6f 20 46 2c 20 | 77 69 74 68 20 61 64 64 |9 to F, |with add|
|000005f0| 72 65 73 73 65 73 20 2a | 2f 0d 2f 2a 20 30 78 46 |resses *|/./* 0xF|
|00000600| 39 39 30 30 30 30 30 20 | 74 6f 20 30 78 46 46 46 |9900000 |to 0xFFF|
|00000610| 30 30 30 30 30 2e 20 54 | 68 65 20 73 6c 6f 74 20 |00000. T|he slot |
|00000620| 6e 75 6d 62 65 72 20 61 | 70 70 65 61 72 73 20 74 |number a|ppears t|
|00000630| 77 69 63 65 20 69 6e 20 | 74 68 65 20 61 64 64 72 |wice in |the addr|
|00000640| 65 73 73 20 2a 2f 0d 2f | 2a 20 69 6e 20 6f 72 64 |ess */./|* in ord|
|00000650| 65 72 20 74 6f 20 62 65 | 20 63 6f 6d 70 61 74 69 |er to be| compati|
|00000660| 62 6c 65 20 77 69 74 68 | 20 4d 61 63 20 49 49 27 |ble with| Mac II'|
|00000670| 73 20 73 75 70 70 6f 72 | 74 69 6e 67 20 65 69 74 |s suppor|ting eit|
|00000680| 68 65 72 20 32 34 20 6f | 72 20 33 32 20 62 69 74 |her 24 o|r 32 bit|
|00000690| 20 2a 2f 0d 2f 2a 20 61 | 64 64 72 65 73 73 69 6e | */./* a|ddressin|
|000006a0| 67 2e 20 54 68 65 20 6d | 61 63 72 6f 20 43 41 52 |g. The m|acro CAR|
|000006b0| 44 42 41 53 45 28 73 6c | 6f 74 29 20 67 65 6e 65 |DBASE(sl|ot) gene|
|000006c0| 72 61 74 65 73 20 74 68 | 65 20 70 72 6f 70 65 72 |rates th|e proper|
|000006d0| 20 61 64 64 72 65 73 73 | 2e 20 2a 2f 0d 0d 23 64 | address|. */..#d|
|000006e0| 65 66 69 6e 65 20 43 41 | 52 44 42 41 53 45 28 73 |efine CA|RDBASE(s|
|000006f0| 6c 6f 74 29 20 28 75 6e | 73 69 67 6e 65 64 20 63 |lot) (un|signed c|
|00000700| 68 61 72 20 2a 29 28 30 | 78 46 30 30 30 30 30 30 |har *)(0|xF000000|
|00000710| 30 2b 30 78 30 31 31 30 | 30 30 30 30 2a 73 6c 6f |0+0x0110|0000*slo|
|00000720| 74 29 0d 23 64 65 66 69 | 6e 65 20 56 69 64 65 6f |t).#defi|ne Video|
|00000730| 42 61 73 65 28 73 6c 6f | 74 29 20 28 75 6e 73 69 |Base(slo|t) (unsi|
|00000740| 67 6e 65 64 20 63 68 61 | 72 20 2a 29 28 30 78 46 |gned cha|r *)(0xF|
|00000750| 30 30 30 30 30 32 30 2b | 30 78 30 31 31 30 30 30 |0000020+|0x011000|
|00000760| 30 30 2a 73 6c 6f 74 29 | 0d 23 64 65 66 69 6e 65 |00*slot)|.#define|
|00000770| 09 54 46 42 42 61 73 65 | 09 09 30 78 38 30 30 30 |.TFBBase|..0x8000|
|00000780| 30 0d 23 64 65 66 69 6e | 65 20 54 46 42 50 61 6e |0.#defin|e TFBPan|
|00000790| 09 09 30 78 38 30 30 30 | 43 0d 23 64 65 66 69 6e |..0x8000|C.#defin|
|000007a0| 65 09 54 46 42 49 42 61 | 73 65 09 30 78 38 66 66 |e.TFBIBa|se.0x8ff|
|000007b0| 66 63 0d 23 64 65 66 69 | 6e 65 20 43 6c 75 74 44 |fc.#defi|ne ClutD|
|000007c0| 61 74 61 52 65 67 09 30 | 78 39 30 30 31 38 0d 23 |ataReg.0|x90018.#|
|000007d0| 64 65 66 69 6e 65 20 43 | 6c 75 74 41 64 64 72 52 |define C|lutAddrR|
|000007e0| 65 67 09 30 78 39 30 30 | 31 43 0d 23 64 65 66 69 |eg.0x900|1C.#defi|
|000007f0| 6e 65 09 52 65 61 64 56 | 53 79 6e 63 09 30 78 44 |ne.ReadV|Sync.0xD|
|00000800| 30 30 30 30 0d 23 64 65 | 66 69 6e 65 09 52 65 61 |0000.#de|fine.Rea|
|00000810| 64 56 49 6e 74 09 30 78 | 44 30 30 30 34 0d 23 64 |dVInt.0x|D0004.#d|
|00000820| 65 66 69 6e 65 09 52 65 | 61 64 49 6e 74 6c 63 09 |efine.Re|adIntlc.|
|00000830| 30 78 44 30 30 30 38 0d | 23 64 65 66 69 6e 65 09 |0xD0008.|#define.|
|00000840| 56 49 6e 74 45 6e 61 62 | 6c 65 09 30 78 41 30 30 |VIntEnab|le.0xA00|
|00000850| 30 30 0d 23 64 65 66 69 | 6e 65 09 56 49 6e 74 44 |00.#defi|ne.VIntD|
|00000860| 69 73 61 62 6c 65 09 30 | 78 41 30 30 30 34 0d 23 |isable.0|xA0004.#|
|00000870| 64 65 66 69 6e 65 20 47 | 45 4e 4c 4f 43 4b 09 09 |define G|ENLOCK..|
|00000880| 38 0d 23 64 65 66 69 6e | 65 09 47 45 4e 4c 4f 43 |8.#defin|e.GENLOC|
|00000890| 4b 52 45 47 09 31 0d 0d | 75 6e 73 69 67 6e 65 64 |KREG.1..|unsigned|
|000008a0| 20 63 68 61 72 20 54 46 | 42 52 65 67 69 73 74 65 | char TF|BRegiste|
|000008b0| 72 56 61 6c 75 65 73 5b | 34 5d 5b 31 36 5d 20 3d |rValues[|4][16] =|
|000008c0| 20 7b 0d 09 7b 33 32 2c | 37 31 2c 30 2c 38 2c 33 | {..{32,|71,0,8,3|
|000008d0| 30 2c 32 32 39 2c 31 31 | 39 2c 37 30 2c 35 2c 32 |0,229,11|9,70,5,2|
|000008e0| 2c 32 2c 31 2c 31 35 2c | 36 35 2c 35 2c 32 30 30 |,2,1,15,|65,5,200|
|000008f0| 7d 2c 09 09 09 2f 2a 20 | 31 20 62 69 74 2f 70 69 |},.../* |1 bit/pi|
|00000900| 78 65 6c 20 2a 2f 0d 09 | 7b 36 34 2c 37 31 2c 30 |xel */..|{64,71,0|
|00000910| 2c 38 2c 36 30 2c 32 32 | 39 2c 31 31 39 2c 37 30 |,8,60,22|9,119,70|
|00000920| 2c 35 2c 36 2c 36 2c 34 | 2c 33 32 2c 34 2c 31 31 |,5,6,6,4|,32,4,11|
|00000930| 2c 32 31 36 7d 2c 09 09 | 09 2f 2a 20 32 20 62 69 |,216},..|./* 2 bi|
|00000940| 74 2f 70 69 78 65 6c 20 | 2a 2f 0d 09 7b 31 32 38 |t/pixel |*/..{128|
|00000950| 2c 37 31 2c 30 2c 38 2c | 31 32 30 2c 32 32 39 2c |,71,0,8,|120,229,|
|00000960| 31 31 39 2c 37 30 2c 35 | 2c 31 34 2c 31 34 2c 31 |119,70,5|,14,14,1|
|00000970| 30 2c 36 36 2c 2d 31 31 | 38 2c 32 32 2c 2d 32 34 |0,66,-11|8,22,-24|
|00000980| 7d 2c 09 2f 2a 20 34 20 | 62 69 74 2f 70 69 78 65 |},./* 4 |bit/pixe|
|00000990| 6c 20 2a 2f 0d 09 7b 30 | 2c 37 31 2c 30 2c 38 2c |l */..{0|,71,0,8,|
|000009a0| 32 34 30 2c 32 32 39 2c | 31 31 39 2c 37 30 2c 35 |240,229,|119,70,5|
|000009b0| 2c 33 30 2c 33 30 2c 32 | 32 2c 31 33 34 2c 31 35 |,30,30,2|2,134,15|
|000009c0| 30 2c 34 35 2c 32 34 39 | 7d 09 09 2f 2a 20 38 20 |0,45,249|}../* 8 |
|000009d0| 62 69 74 2f 70 69 78 65 | 6c 20 2a 2f 0d 7d 3b 0d |bit/pixe|l */.};.|
|000009e0| 0d 75 6e 73 69 67 6e 65 | 64 20 63 68 61 72 20 4e |.unsigne|d char N|
|000009f0| 74 73 63 56 61 6c 75 65 | 73 5b 31 36 5d 20 3d 0d |tscValue|s[16] =.|
|00000a00| 09 7b 30 2c 31 38 33 2c | 30 2c 38 2c 39 36 2c 32 |.{0,183,|0,8,96,2|
|00000a10| 32 39 2c 35 39 2c 32 35 | 2c 35 2c 38 2c 32 36 2c |29,59,25|,5,8,26,|
|00000a20| 31 34 2c 31 33 32 2c 31 | 34 2c 34 36 2c 32 34 39 |14,132,1|4,46,249|
|00000a30| 7d 3b 09 09 2f 2a 20 66 | 72 6f 6d 20 4e 74 73 63 |};../* f|rom Ntsc|
|00000a40| 46 6b 65 79 20 2a 2f 0d | 0d 0d 42 6f 6f 6c 65 61 |Fkey */.|..Boolea|
|00000a50| 6e 20 54 46 42 49 6e 53 | 6c 6f 74 28 69 6e 74 20 |n TFBInS|lot(int |
|00000a60| 73 6c 6f 74 29 0d 7b 0d | 09 47 44 48 61 6e 64 6c |slot).{.|.GDHandl|
|00000a70| 65 20 64 65 76 69 63 65 | 3b 0d 09 73 74 61 74 69 |e device|;..stati|
|00000a80| 63 20 42 6f 6f 6c 65 61 | 6e 20 74 65 73 74 65 64 |c Boolea|n tested|
|00000a90| 5b 31 36 5d 3d 7b 30 2c | 30 2c 30 2c 30 2c 30 2c |[16]={0,|0,0,0,0,|
|00000aa0| 30 2c 30 2c 30 2c 30 2c | 30 2c 30 2c 30 2c 30 2c |0,0,0,0,|0,0,0,0,|
|00000ab0| 30 2c 30 2c 30 7d 3b 0d | 09 73 74 61 74 69 63 20 |0,0,0};.|.static |
|00000ac0| 42 6f 6f 6c 65 61 6e 20 | 6f 6b 5b 31 36 5d 3b 0d |Boolean |ok[16];.|
|00000ad0| 09 0d 09 69 66 28 73 6c | 6f 74 3e 31 35 29 72 65 |...if(sl|ot>15)re|
|00000ae0| 74 75 72 6e 20 30 3b 0d | 09 69 66 28 21 74 65 73 |turn 0;.|.if(!tes|
|00000af0| 74 65 64 5b 73 6c 6f 74 | 5d 29 7b 0d 09 09 74 65 |ted[slot|]){...te|
|00000b00| 73 74 65 64 5b 73 6c 6f | 74 5d 3d 31 3b 0d 09 09 |sted[slo|t]=1;...|
|00000b10| 64 65 76 69 63 65 3d 53 | 6c 6f 74 54 6f 53 63 72 |device=S|lotToScr|
|00000b20| 65 65 6e 44 65 76 69 63 | 65 28 73 6c 6f 74 29 3b |eenDevic|e(slot);|
|00000b30| 0d 09 09 6f 6b 5b 73 6c | 6f 74 5d 3d 45 71 75 61 |...ok[sl|ot]=Equa|
|00000b40| 6c 53 74 72 69 6e 67 28 | 22 5c 70 2e 44 69 73 70 |lString(|"\p.Disp|
|00000b50| 6c 61 79 5f 56 69 64 65 | 6f 5f 41 70 70 6c 65 5f |lay_Vide|o_Apple_|
|00000b60| 54 46 42 22 2c 47 44 4e | 61 6d 65 28 64 65 76 69 |TFB",GDN|ame(devi|
|00000b70| 63 65 29 2c 31 2c 31 29 | 3b 0d 09 7d 0d 09 72 65 |ce),1,1)|;..}..re|
|00000b80| 74 75 72 6e 20 6f 6b 5b | 73 6c 6f 74 5d 3b 0d 7d |turn ok[|slot];.}|
|00000b90| 0d 0d 76 6f 69 64 20 53 | 65 74 55 70 54 46 42 28 |..void S|etUpTFB(|
|00000ba0| 69 6e 74 20 73 6c 6f 74 | 29 0d 7b 0d 09 72 65 67 |int slot|).{..reg|
|00000bb0| 69 73 74 65 72 20 75 6e | 73 69 67 6e 65 64 20 63 |ister un|signed c|
|00000bc0| 68 61 72 20 2a 64 73 74 | 50 74 72 42 2c 2a 73 72 |har *dst|PtrB,*sr|
|00000bd0| 63 50 74 72 42 3b 0d 09 | 72 65 67 69 73 74 65 72 |cPtrB;..|register|
|00000be0| 20 6c 6f 6e 67 20 69 6e | 74 20 69 3b 0d 0d 09 69 | long in|t i;...i|
|00000bf0| 66 28 21 54 46 42 49 6e | 53 6c 6f 74 28 73 6c 6f |f(!TFBIn|Slot(slo|
|00000c00| 74 29 29 7b 0d 09 09 70 | 72 69 6e 74 66 28 22 54 |t)){...p|rintf("T|
|00000c10| 68 65 20 63 61 72 64 20 | 69 6e 20 73 6c 6f 74 20 |he card |in slot |
|00000c20| 25 64 20 69 73 20 6e 6f | 74 20 61 20 54 46 42 20 |%d is no|t a TFB |
|00000c30| 63 61 72 64 21 5c 6e 22 | 2c 73 6c 6f 74 29 3b 0d |card!\n"|,slot);.|
|00000c40| 09 09 72 65 74 75 72 6e | 3b 0d 09 7d 0d 09 64 73 |..return|;..}..ds|
|00000c50| 74 50 74 72 42 20 3d 20 | 43 41 52 44 42 41 53 45 |tPtrB = |CARDBASE|
|00000c60| 28 73 6c 6f 74 29 20 2b | 20 54 46 42 49 42 61 73 |(slot) +| TFBIBas|
|00000c70| 65 3b 0d 09 73 72 63 50 | 74 72 42 20 3d 20 26 54 |e;..srcP|trB = &T|
|00000c80| 46 42 52 65 67 69 73 74 | 65 72 56 61 6c 75 65 73 |FBRegist|erValues|
|00000c90| 5b 30 5d 5b 30 5d 3b 0d | 09 66 6f 72 20 28 69 3d |[0][0];.|.for (i=|
|00000ca0| 31 35 3b 20 69 3e 3d 30 | 3b 20 69 2d 2d 29 20 7b |15; i>=0|; i--) {|
|00000cb0| 0d 09 09 2a 64 73 74 50 | 74 72 42 20 3d 20 7e 2a |...*dstP|trB = ~*|
|00000cc0| 73 72 63 50 74 72 42 2b | 2b 3b 0d 09 09 64 73 74 |srcPtrB+|+;...dst|
|00000cd0| 50 74 72 42 20 2d 3d 20 | 34 3b 0d 09 7d 0d 7d 0d |PtrB -= |4;..}.}.|
|00000ce0| 0d 76 6f 69 64 20 52 61 | 6d 70 43 6c 75 74 54 46 |.void Ra|mpClutTF|
|00000cf0| 42 28 69 6e 74 20 73 6c | 6f 74 29 0d 2f 2a 20 6c |B(int sl|ot)./* l|
|00000d00| 6f 61 64 73 20 74 68 65 | 20 63 6c 75 74 20 77 69 |oads the| clut wi|
|00000d10| 74 68 20 61 6e 20 69 64 | 65 6e 74 69 63 61 6c 20 |th an id|entical |
|00000d20| 6c 69 6e 65 61 72 20 72 | 61 6d 70 20 69 6e 20 52 |linear r|amp in R|
|00000d30| 2c 20 47 2c 20 61 6e 64 | 20 42 2e 20 2a 2f 0d 7b |, G, and| B. */.{|
|00000d40| 0d 09 72 65 67 69 73 74 | 65 72 20 75 6e 73 69 67 |..regist|er unsig|
|00000d50| 6e 65 64 20 63 68 61 72 | 20 2a 64 73 74 50 74 72 |ned char| *dstPtr|
|00000d60| 42 3b 0d 09 72 65 67 69 | 73 74 65 72 20 69 6e 74 |B;..regi|ster int|
|00000d70| 20 69 3b 0d 0d 09 69 66 | 28 21 54 46 42 49 6e 53 | i;...if|(!TFBInS|
|00000d80| 6c 6f 74 28 73 6c 6f 74 | 29 29 7b 0d 09 09 70 72 |lot(slot|)){...pr|
|00000d90| 69 6e 74 66 28 22 54 68 | 65 20 63 61 72 64 20 69 |intf("Th|e card i|
|00000da0| 6e 20 73 6c 6f 74 20 25 | 64 20 69 73 20 6e 6f 74 |n slot %|d is not|
|00000db0| 20 61 20 54 46 42 20 63 | 61 72 64 21 5c 6e 22 2c | a TFB c|ard!\n",|
|00000dc0| 73 6c 6f 74 29 3b 0d 09 | 09 72 65 74 75 72 6e 3b |slot);..|.return;|
|00000dd0| 0d 09 7d 0d 09 2a 28 43 | 41 52 44 42 41 53 45 28 |..}..*(C|ARDBASE(|
|00000de0| 73 6c 6f 74 29 20 2b 20 | 43 6c 75 74 41 64 64 72 |slot) + |ClutAddr|
|00000df0| 52 65 67 29 20 3d 20 32 | 35 35 3b 0d 09 64 73 74 |Reg) = 2|55;..dst|
|00000e00| 50 74 72 42 20 3d 20 43 | 41 52 44 42 41 53 45 28 |PtrB = C|ARDBASE(|
|00000e10| 73 6c 6f 74 29 20 2b 20 | 43 6c 75 74 44 61 74 61 |slot) + |ClutData|
|00000e20| 52 65 67 3b 0d 09 66 6f | 72 20 28 69 3d 32 35 35 |Reg;..fo|r (i=255|
|00000e30| 3b 20 69 20 3e 3d 20 30 | 3b 20 69 2d 2d 29 7b 0d |; i >= 0|; i--){.|
|00000e40| 09 09 2a 64 73 74 50 74 | 72 42 20 3d 20 2a 64 73 |..*dstPt|rB = *ds|
|00000e50| 74 50 74 72 42 20 3d 20 | 2a 64 73 74 50 74 72 42 |tPtrB = |*dstPtrB|
|00000e60| 20 3d 20 28 75 6e 73 69 | 67 6e 65 64 20 63 68 61 | = (unsi|gned cha|
|00000e70| 72 29 20 69 3b 0d 09 7d | 0d 09 72 65 74 75 72 6e |r) i;..}|..return|
|00000e80| 3b 0d 7d 0d 0d 76 6f 69 | 64 20 47 72 61 79 43 6c |;.}..voi|d GrayCl|
|00000e90| 75 74 54 46 42 28 69 6e | 74 20 73 6c 6f 74 29 0d |utTFB(in|t slot).|
|00000ea0| 2f 2a 20 6c 6f 61 64 73 | 20 74 68 65 20 65 6e 74 |/* loads| the ent|
|00000eb0| 69 72 65 20 63 6c 75 74 | 20 77 69 74 68 20 75 6e |ire clut| with un|
|00000ec0| 69 66 6f 72 6d 20 67 72 | 61 79 2e 20 2a 2f 0d 7b |iform gr|ay. */.{|
|00000ed0| 0d 09 72 65 67 69 73 74 | 65 72 20 75 6e 73 69 67 |..regist|er unsig|
|00000ee0| 6e 65 64 20 63 68 61 72 | 20 2a 64 73 74 50 74 72 |ned char| *dstPtr|
|00000ef0| 42 3b 0d 09 72 65 67 69 | 73 74 65 72 20 69 6e 74 |B;..regi|ster int|
|00000f00| 20 69 3b 0d 0d 09 69 66 | 28 21 54 46 42 49 6e 53 | i;...if|(!TFBInS|
|00000f10| 6c 6f 74 28 73 6c 6f 74 | 29 29 7b 0d 09 09 70 72 |lot(slot|)){...pr|
|00000f20| 69 6e 74 66 28 22 54 68 | 65 20 63 61 72 64 20 69 |intf("Th|e card i|
|00000f30| 6e 20 73 6c 6f 74 20 25 | 64 20 69 73 20 6e 6f 74 |n slot %|d is not|
|00000f40| 20 61 20 54 46 42 20 63 | 61 72 64 21 5c 6e 22 2c | a TFB c|ard!\n",|
|00000f50| 73 6c 6f 74 29 3b 0d 09 | 09 72 65 74 75 72 6e 3b |slot);..|.return;|
|00000f60| 0d 09 7d 0d 09 2a 28 43 | 41 52 44 42 41 53 45 28 |..}..*(C|ARDBASE(|
|00000f70| 73 6c 6f 74 29 20 2b 20 | 43 6c 75 74 41 64 64 72 |slot) + |ClutAddr|
|00000f80| 52 65 67 29 20 3d 20 32 | 35 35 3b 0d 09 64 73 74 |Reg) = 2|55;..dst|
|00000f90| 50 74 72 42 20 3d 20 43 | 41 52 44 42 41 53 45 28 |PtrB = C|ARDBASE(|
|00000fa0| 73 6c 6f 74 29 20 2b 20 | 43 6c 75 74 44 61 74 61 |slot) + |ClutData|
|00000fb0| 52 65 67 3b 0d 09 2a 64 | 73 74 50 74 72 42 20 3d |Reg;..*d|stPtrB =|
|00000fc0| 20 2a 64 73 74 50 74 72 | 42 20 3d 20 2a 64 73 74 | *dstPtr|B = *dst|
|00000fd0| 50 74 72 42 20 3d 20 28 | 75 6e 73 69 67 6e 65 64 |PtrB = (|unsigned|
|00000fe0| 20 63 68 61 72 29 20 32 | 35 35 3b 0d 09 66 6f 72 | char) 2|55;..for|
|00000ff0| 20 28 69 3d 32 35 34 3b | 20 69 20 3e 3d 20 31 3b | (i=254;| i >= 1;|
|00001000| 20 69 2d 2d 29 7b 0d 09 | 09 2a 64 73 74 50 74 72 | i--){..|.*dstPtr|
|00001010| 42 20 3d 20 2a 64 73 74 | 50 74 72 42 20 3d 20 2a |B = *dst|PtrB = *|
|00001020| 64 73 74 50 74 72 42 20 | 3d 20 28 75 6e 73 69 67 |dstPtrB |= (unsig|
|00001030| 6e 65 64 20 63 68 61 72 | 29 20 31 32 37 3b 0d 09 |ned char|) 127;..|
|00001040| 7d 0d 09 2a 64 73 74 50 | 74 72 42 20 3d 20 2a 64 |}..*dstP|trB = *d|
|00001050| 73 74 50 74 72 42 20 3d | 20 2a 64 73 74 50 74 72 |stPtrB =| *dstPtr|
|00001060| 42 20 3d 20 28 75 6e 73 | 69 67 6e 65 64 20 63 68 |B = (uns|igned ch|
|00001070| 61 72 29 20 30 3b 0d 09 | 72 65 74 75 72 6e 3b 0d |ar) 0;..|return;.|
|00001080| 7d 0d 0d 76 6f 69 64 20 | 4c 6f 61 64 43 6c 75 74 |}..void |LoadClut|
|00001090| 54 46 42 28 69 6e 74 20 | 73 6c 6f 74 2c 75 6e 73 |TFB(int |slot,uns|
|000010a0| 69 67 6e 65 64 20 63 68 | 61 72 20 72 67 62 5b 32 |igned ch|ar rgb[2|
|000010b0| 35 36 5d 5b 33 5d 29 0d | 2f 2a 20 6c 6f 61 64 73 |56][3]).|/* loads|
|000010c0| 20 74 68 65 20 63 6c 75 | 74 20 77 69 74 68 20 61 | the clu|t with a|
|000010d0| 20 75 73 65 72 2d 73 75 | 70 70 6c 69 65 64 20 61 | user-su|pplied a|
|000010e0| 72 72 61 79 2e 20 2a 2f | 0d 7b 0d 09 72 65 67 69 |rray. */|.{..regi|
|000010f0| 73 74 65 72 20 75 6e 73 | 69 67 6e 65 64 20 63 68 |ster uns|igned ch|
|00001100| 61 72 20 2a 73 72 63 50 | 74 72 42 2c 2a 64 73 74 |ar *srcP|trB,*dst|
|00001110| 50 74 72 42 3b 0d 09 72 | 65 67 69 73 74 65 72 20 |PtrB;..r|egister |
|00001120| 69 6e 74 20 69 3b 0d 0d | 0d 09 69 66 28 21 54 46 |int i;..|..if(!TF|
|00001130| 42 49 6e 53 6c 6f 74 28 | 73 6c 6f 74 29 29 7b 0d |BInSlot(|slot)){.|
|00001140| 09 09 70 72 69 6e 74 66 | 28 22 54 68 65 20 63 61 |..printf|("The ca|
|00001150| 72 64 20 69 6e 20 73 6c | 6f 74 20 25 64 20 69 73 |rd in sl|ot %d is|
|00001160| 20 6e 6f 74 20 61 20 54 | 46 42 20 63 61 72 64 21 | not a T|FB card!|
|00001170| 5c 6e 22 2c 73 6c 6f 74 | 29 3b 0d 09 09 72 65 74 |\n",slot|);...ret|
|00001180| 75 72 6e 3b 0d 09 7d 0d | 09 2a 28 43 41 52 44 42 |urn;..}.|.*(CARDB|
|00001190| 41 53 45 28 73 6c 6f 74 | 29 20 2b 20 43 6c 75 74 |ASE(slot|) + Clut|
|000011a0| 41 64 64 72 52 65 67 29 | 20 3d 20 32 35 35 3b 0d |AddrReg)| = 255;.|
|000011b0| 09 64 73 74 50 74 72 42 | 20 3d 20 43 41 52 44 42 |.dstPtrB| = CARDB|
|000011c0| 41 53 45 28 73 6c 6f 74 | 29 20 2b 20 43 6c 75 74 |ASE(slot|) + Clut|
|000011d0| 44 61 74 61 52 65 67 3b | 0d 09 73 72 63 50 74 72 |DataReg;|..srcPtr|
|000011e0| 42 20 3d 20 26 72 67 62 | 5b 32 35 35 5d 5b 32 5d |B = &rgb|[255][2]|
|000011f0| 3b 0d 09 73 72 63 50 74 | 72 42 2b 2b 3b 0d 09 66 |;..srcPt|rB++;..f|
|00001200| 6f 72 20 28 69 3d 32 35 | 35 2f 34 3b 20 69 20 3e |or (i=25|5/4; i >|
|00001210| 3d 20 30 3b 20 69 2d 2d | 29 7b 0d 09 09 2a 64 73 |= 0; i--|){...*ds|
|00001220| 74 50 74 72 42 20 3d 20 | 2a 28 2d 2d 73 72 63 50 |tPtrB = |*(--srcP|
|00001230| 74 72 42 29 3b 0d 09 09 | 2a 64 73 74 50 74 72 42 |trB);...|*dstPtrB|
|00001240| 20 3d 20 2a 28 2d 2d 73 | 72 63 50 74 72 42 29 3b | = *(--s|rcPtrB);|
|00001250| 0d 09 09 2a 64 73 74 50 | 74 72 42 20 3d 20 2a 28 |...*dstP|trB = *(|
|00001260| 2d 2d 73 72 63 50 74 72 | 42 29 3b 0d 0d 09 09 2a |--srcPtr|B);....*|
|00001270| 64 73 74 50 74 72 42 20 | 3d 20 2a 28 2d 2d 73 72 |dstPtrB |= *(--sr|
|00001280| 63 50 74 72 42 29 3b 0d | 09 09 2a 64 73 74 50 74 |cPtrB);.|..*dstPt|
|00001290| 72 42 20 3d 20 2a 28 2d | 2d 73 72 63 50 74 72 42 |rB = *(-|-srcPtrB|
|000012a0| 29 3b 0d 09 09 2a 64 73 | 74 50 74 72 42 20 3d 20 |);...*ds|tPtrB = |
|000012b0| 2a 28 2d 2d 73 72 63 50 | 74 72 42 29 3b 0d 0d 09 |*(--srcP|trB);...|
|000012c0| 09 2a 64 73 74 50 74 72 | 42 20 3d 20 2a 28 2d 2d |.*dstPtr|B = *(--|
|000012d0| 73 72 63 50 74 72 42 29 | 3b 0d 09 09 2a 64 73 74 |srcPtrB)|;...*dst|
|000012e0| 50 74 72 42 20 3d 20 2a | 28 2d 2d 73 72 63 50 74 |PtrB = *|(--srcPt|
|000012f0| 72 42 29 3b 0d 09 09 2a | 64 73 74 50 74 72 42 20 |rB);...*|dstPtrB |
|00001300| 3d 20 2a 28 2d 2d 73 72 | 63 50 74 72 42 29 3b 0d |= *(--sr|cPtrB);.|
|00001310| 0d 09 09 2a 64 73 74 50 | 74 72 42 20 3d 20 2a 28 |...*dstP|trB = *(|
|00001320| 2d 2d 73 72 63 50 74 72 | 42 29 3b 0d 09 09 2a 64 |--srcPtr|B);...*d|
|00001330| 73 74 50 74 72 42 20 3d | 20 2a 28 2d 2d 73 72 63 |stPtrB =| *(--src|
|00001340| 50 74 72 42 29 3b 0d 09 | 09 2a 64 73 74 50 74 72 |PtrB);..|.*dstPtr|
|00001350| 42 20 3d 20 2a 28 2d 2d | 73 72 63 50 74 72 42 29 |B = *(--|srcPtrB)|
|00001360| 3b 0d 09 7d 0d 09 72 65 | 74 75 72 6e 3b 0d 7d 0d |;..}..re|turn;.}.|
|00001370| 0d 76 6f 69 64 20 4e 65 | 77 42 6c 61 6e 6b 69 6e |.void Ne|wBlankin|
|00001380| 67 54 46 42 28 69 6e 74 | 20 73 6c 6f 74 29 0d 2f |gTFB(int| slot)./|
|00001390| 2a 20 4e 65 77 42 6c 61 | 6e 6b 69 6e 67 54 46 42 |* NewBla|nkingTFB|
|000013a0| 20 77 61 69 74 73 20 66 | 6f 72 20 74 68 65 20 62 | waits f|or the b|
|000013b0| 65 67 69 6e 6e 69 6e 67 | 20 6f 66 20 74 68 65 20 |eginning| of the |
|000013c0| 6e 65 78 74 20 76 65 72 | 74 69 63 61 6c 20 62 6c |next ver|tical bl|
|000013d0| 61 6e 6b 69 6e 67 20 69 | 6e 74 65 72 76 61 6c 20 |anking i|nterval |
|000013e0| 2a 2f 0d 2f 2a 20 54 68 | 65 20 73 74 61 6e 64 61 |*/./* Th|e standa|
|000013f0| 72 64 20 41 70 70 6c 65 | 20 76 69 64 65 6f 20 72 |rd Apple| video r|
|00001400| 61 74 65 20 69 73 20 36 | 36 2e 36 37 20 48 7a 20 |ate is 6|6.67 Hz |
|00001410| 2a 2f 0d 7b 0d 09 72 65 | 67 69 73 74 65 72 20 6c |*/.{..re|gister l|
|00001420| 6f 6e 67 20 2a 62 6c 61 | 6e 6b 69 6e 67 50 74 72 |ong *bla|nkingPtr|
|00001430| 3b 0d 0d 09 69 66 28 21 | 54 46 42 49 6e 53 6c 6f |;...if(!|TFBInSlo|
|00001440| 74 28 73 6c 6f 74 29 29 | 7b 0d 09 09 70 72 69 6e |t(slot))|{...prin|
|00001450| 74 66 28 22 54 68 65 20 | 63 61 72 64 20 69 6e 20 |tf("The |card in |
|00001460| 73 6c 6f 74 20 25 64 20 | 69 73 20 6e 6f 74 20 61 |slot %d |is not a|
|00001470| 20 54 46 42 20 63 61 72 | 64 21 5c 6e 22 2c 73 6c | TFB car|d!\n",sl|
|00001480| 6f 74 29 3b 0d 09 09 72 | 65 74 75 72 6e 3b 0d 09 |ot);...r|eturn;..|
|00001490| 7d 0d 09 62 6c 61 6e 6b | 69 6e 67 50 74 72 20 3d |}..blank|ingPtr =|
|000014a0| 20 28 6c 6f 6e 67 20 2a | 29 20 28 43 41 52 44 42 | (long *|) (CARDB|
|000014b0| 41 53 45 28 73 6c 6f 74 | 29 20 2b 20 52 65 61 64 |ASE(slot|) + Read|
|000014c0| 56 53 79 6e 63 29 3b 0d | 09 77 68 69 6c 65 20 28 |VSync);.|.while (|
|000014d0| 2a 62 6c 61 6e 6b 69 6e | 67 50 74 72 20 26 20 31 |*blankin|gPtr & 1|
|000014e0| 4c 29 20 3b 20 2f 2a 20 | 6a 75 73 74 20 69 6e 20 |L) ; /* |just in |
|000014f0| 63 61 73 65 20 77 65 27 | 72 65 20 69 6e 20 61 20 |case we'|re in a |
|00001500| 74 69 67 68 74 20 6c 6f | 6f 70 2c 20 77 61 69 74 |tight lo|op, wait|
|00001510| 20 66 6f 72 20 65 6e 64 | 20 6f 66 20 62 6c 61 6e | for end| of blan|
|00001520| 6b 69 6e 67 20 2a 2f 0d | 09 77 68 69 6c 65 20 28 |king */.|.while (|
|00001530| 21 28 2a 62 6c 61 6e 6b | 69 6e 67 50 74 72 20 26 |!(*blank|ingPtr &|
|00001540| 20 31 4c 29 29 20 3b 20 | 2f 2a 20 77 61 69 74 20 | 1L)) ; |/* wait |
|00001550| 75 6e 74 69 6c 20 62 65 | 67 69 6e 6e 69 6e 67 20 |until be|ginning |
|00001560| 6f 66 20 62 6c 61 6e 6b | 69 6e 67 20 69 6e 74 65 |of blank|ing inte|
|00001570| 72 76 61 6c 20 2a 2f 0d | 09 72 65 74 75 72 6e 3b |rval */.|.return;|
|00001580| 0d 7d 0d 0d 76 6f 69 64 | 20 4e 65 77 46 69 65 6c |.}..void| NewFiel|
|00001590| 64 54 46 42 28 69 6e 74 | 20 73 6c 6f 74 29 0d 2f |dTFB(int| slot)./|
|000015a0| 2a 20 4e 65 77 46 69 65 | 6c 64 54 46 42 20 77 61 |* NewFie|ldTFB wa|
|000015b0| 69 74 73 20 66 6f 72 20 | 74 68 65 20 62 65 67 69 |its for |the begi|
|000015c0| 6e 6e 69 6e 67 20 6f 66 | 20 74 68 65 20 6e 65 78 |nning of| the nex|
|000015d0| 74 20 76 69 64 65 6f 20 | 66 69 65 6c 64 20 2a 2f |t video |field */|
|000015e0| 0d 2f 2a 20 54 68 65 20 | 73 74 61 6e 64 61 72 64 |./* The |standard|
|000015f0| 20 41 70 70 6c 65 20 76 | 69 64 65 6f 20 72 61 74 | Apple v|ideo rat|
|00001600| 65 20 69 73 20 36 36 2e | 36 37 20 48 7a 20 2a 2f |e is 66.|67 Hz */|
|00001610| 0d 7b 0d 09 72 65 67 69 | 73 74 65 72 20 6c 6f 6e |.{..regi|ster lon|
|00001620| 67 20 2a 62 6c 61 6e 6b | 69 6e 67 50 74 72 3b 0d |g *blank|ingPtr;.|
|00001630| 0d 09 69 66 28 21 54 46 | 42 49 6e 53 6c 6f 74 28 |..if(!TF|BInSlot(|
|00001640| 73 6c 6f 74 29 29 7b 0d | 09 09 70 72 69 6e 74 66 |slot)){.|..printf|
|00001650| 28 22 54 68 65 20 63 61 | 72 64 20 69 6e 20 73 6c |("The ca|rd in sl|
|00001660| 6f 74 20 25 64 20 69 73 | 20 6e 6f 74 20 61 20 54 |ot %d is| not a T|
|00001670| 46 42 20 63 61 72 64 21 | 5c 6e 22 2c 73 6c 6f 74 |FB card!|\n",slot|
|00001680| 29 3b 0d 09 09 72 65 74 | 75 72 6e 3b 0d 09 7d 0d |);...ret|urn;..}.|
|00001690| 09 62 6c 61 6e 6b 69 6e | 67 50 74 72 20 3d 20 28 |.blankin|gPtr = (|
|000016a0| 6c 6f 6e 67 20 2a 29 20 | 28 43 41 52 44 42 41 53 |long *) |(CARDBAS|
|000016b0| 45 28 73 6c 6f 74 29 20 | 2b 20 52 65 61 64 56 53 |E(slot) |+ ReadVS|
|000016c0| 79 6e 63 29 3b 0d 09 77 | 68 69 6c 65 20 28 21 28 |ync);..w|hile (!(|
|000016d0| 2a 62 6c 61 6e 6b 69 6e | 67 50 74 72 20 26 20 31 |*blankin|gPtr & 1|
|000016e0| 4c 29 29 20 3b 09 2f 2a | 20 77 61 69 74 20 75 6e |L)) ;./*| wait un|
|000016f0| 74 69 6c 20 62 65 67 69 | 6e 6e 69 6e 67 20 6f 66 |til begi|nning of|
|00001700| 20 62 6c 61 6e 6b 69 6e | 67 20 69 6e 74 65 72 76 | blankin|g interv|
|00001710| 61 6c 20 2a 2f 0d 09 77 | 68 69 6c 65 20 28 2a 62 |al */..w|hile (*b|
|00001720| 6c 61 6e 6b 69 6e 67 50 | 74 72 20 26 20 31 4c 29 |lankingP|tr & 1L)|
|00001730| 20 3b 09 09 2f 2a 20 77 | 61 69 74 20 66 6f 72 20 | ;../* w|ait for |
|00001740| 65 6e 64 20 6f 66 20 62 | 6c 61 6e 6b 69 6e 67 20 |end of b|lanking |
|00001750| 2a 2f 0d 09 72 65 74 75 | 72 6e 3b 0d 7d 0d 0d 69 |*/..retu|rn;.}..i|
|00001760| 6e 74 20 42 6c 61 6e 6b | 69 6e 67 54 46 42 28 69 |nt Blank|ingTFB(i|
|00001770| 6e 74 20 73 6c 6f 74 29 | 0d 2f 2a 20 72 65 74 75 |nt slot)|./* retu|
|00001780| 72 6e 73 20 74 72 75 65 | 20 64 75 72 69 6e 67 20 |rns true| during |
|00001790| 74 68 65 20 62 6c 61 6e | 6b 69 6e 67 20 69 6e 74 |the blan|king int|
|000017a0| 65 72 76 61 6c 20 2a 2f | 0d 7b 0d 09 72 65 67 69 |erval */|.{..regi|
|000017b0| 73 74 65 72 20 6c 6f 6e | 67 20 2a 62 6c 61 6e 6b |ster lon|g *blank|
|000017c0| 69 6e 67 50 74 72 3b 0d | 0d 09 69 66 28 21 54 46 |ingPtr;.|..if(!TF|
|000017d0| 42 49 6e 53 6c 6f 74 28 | 73 6c 6f 74 29 29 7b 0d |BInSlot(|slot)){.|
|000017e0| 09 09 70 72 69 6e 74 66 | 28 22 54 68 65 20 63 61 |..printf|("The ca|
|000017f0| 72 64 20 69 6e 20 73 6c | 6f 74 20 25 64 20 69 73 |rd in sl|ot %d is|
|00001800| 20 6e 6f 74 20 61 20 54 | 46 42 20 63 61 72 64 21 | not a T|FB card!|
|00001810| 5c 6e 22 2c 73 6c 6f 74 | 29 3b 0d 09 09 72 65 74 |\n",slot|);...ret|
|00001820| 75 72 6e 20 30 3b 0d 09 | 7d 0d 09 62 6c 61 6e 6b |urn 0;..|}..blank|
|00001830| 69 6e 67 50 74 72 20 3d | 20 28 6c 6f 6e 67 20 2a |ingPtr =| (long *|
|00001840| 29 20 28 43 41 52 44 42 | 41 53 45 28 73 6c 6f 74 |) (CARDB|ASE(slot|
|00001850| 29 20 2b 20 52 65 61 64 | 56 53 79 6e 63 29 3b 0d |) + Read|VSync);.|
|00001860| 09 72 65 74 75 72 6e 20 | 28 69 6e 74 29 20 28 2a |.return |(int) (*|
|00001870| 62 6c 61 6e 6b 69 6e 67 | 50 74 72 20 26 20 31 4c |blanking|Ptr & 1L|
|00001880| 29 3b 0d 7d 0d 0d 0d 76 | 6f 69 64 20 53 65 74 44 |);.}...v|oid SetD|
|00001890| 65 70 74 68 54 46 42 28 | 69 6e 74 20 73 6c 6f 74 |epthTFB(|int slot|
|000018a0| 2c 73 68 6f 72 74 20 62 | 69 74 73 29 0d 2f 2a 20 |,short b|its)./* |
|000018b0| 73 65 74 73 20 75 70 20 | 74 68 65 20 76 69 64 65 |sets up |the vide|
|000018c0| 6f 20 63 61 72 64 20 66 | 6f 72 20 74 68 65 20 64 |o card f|or the d|
|000018d0| 65 73 69 72 65 64 20 6e | 75 6d 62 65 72 20 6f 66 |esired n|umber of|
|000018e0| 20 62 69 74 73 2f 70 69 | 78 65 6c 3a 20 31 2c 20 | bits/pi|xel: 1, |
|000018f0| 32 2c 20 34 2c 20 6f 72 | 20 38 20 2a 2f 0d 7b 0d |2, 4, or| 8 */.{.|
|00001900| 09 72 65 67 69 73 74 65 | 72 20 75 6e 73 69 67 6e |.registe|r unsign|
|00001910| 65 64 20 63 68 61 72 20 | 2a 64 73 74 50 74 72 42 |ed char |*dstPtrB|
|00001920| 2c 20 2a 73 72 63 50 74 | 72 42 3b 0d 09 72 65 67 |, *srcPt|rB;..reg|
|00001930| 69 73 74 65 72 20 6c 6f | 6e 67 20 69 6e 74 20 69 |ister lo|ng int i|
|00001940| 3b 0d 09 73 68 6f 72 74 | 20 69 6e 74 20 6c 6f 67 |;..short| int log|
|00001950| 32 62 69 74 73 3b 09 09 | 2f 2a 20 3d 20 6c 6f 67 |2bits;..|/* = log|
|00001960| 32 28 62 69 74 73 29 20 | 2a 2f 0d 0d 09 69 66 28 |2(bits) |*/...if(|
|00001970| 21 54 46 42 49 6e 53 6c | 6f 74 28 73 6c 6f 74 29 |!TFBInSl|ot(slot)|
|00001980| 29 7b 0d 09 09 70 72 69 | 6e 74 66 28 22 54 68 65 |){...pri|ntf("The|
|00001990| 20 63 61 72 64 20 69 6e | 20 73 6c 6f 74 20 25 64 | card in| slot %d|
|000019a0| 20 69 73 20 6e 6f 74 20 | 61 20 54 46 42 20 63 61 | is not |a TFB ca|
|000019b0| 72 64 21 5c 6e 22 2c 73 | 6c 6f 74 29 3b 0d 09 09 |rd!\n",s|lot);...|
|000019c0| 72 65 74 75 72 6e 3b 0d | 09 7d 0d 09 69 66 28 62 |return;.|.}..if(b|
|000019d0| 69 74 73 20 3e 20 38 29 | 20 72 65 74 75 72 6e 3b |its > 8)| return;|
|000019e0| 0d 09 6c 6f 67 32 62 69 | 74 73 20 3d 20 30 3b 0d |..log2bi|ts = 0;.|
|000019f0| 09 77 68 69 6c 65 20 28 | 20 28 62 69 74 73 20 2f |.while (| (bits /|
|00001a00| 3d 20 32 29 20 3e 20 30 | 20 29 20 6c 6f 67 32 62 |= 2) > 0| ) log2b|
|00001a10| 69 74 73 2b 2b 3b 0d 09 | 64 73 74 50 74 72 42 20 |its++;..|dstPtrB |
|00001a20| 3d 20 28 43 41 52 44 42 | 41 53 45 28 73 6c 6f 74 |= (CARDB|ASE(slot|
|00001a30| 29 20 2b 20 54 46 42 42 | 61 73 65 29 3b 0d 09 73 |) + TFBB|ase);..s|
|00001a40| 72 63 50 74 72 42 20 3d | 20 26 28 54 46 42 52 65 |rcPtrB =| &(TFBRe|
|00001a50| 67 69 73 74 65 72 56 61 | 6c 75 65 73 5b 6c 6f 67 |gisterVa|lues[log|
|00001a60| 32 62 69 74 73 5d 5b 30 | 5d 29 3b 09 0d 09 4e 65 |2bits][0|]);...Ne|
|00001a70| 77 46 69 65 6c 64 54 46 | 42 28 73 6c 6f 74 29 3b |wFieldTF|B(slot);|
|00001a80| 0d 09 2a 28 64 73 74 50 | 74 72 42 20 2b 20 31 35 |..*(dstP|trB + 15|
|00001a90| 2a 34 29 20 3d 20 28 63 | 68 61 72 29 20 30 78 42 |*4) = (c|har) 0xB|
|00001aa0| 37 3b 09 2f 2a 20 50 72 | 65 6c 6f 61 64 20 72 65 |7;./* Pr|eload re|
|00001ab0| 67 69 73 74 65 72 31 35 | 2e 20 50 75 74 20 74 68 |gister15|. Put th|
|00001ac0| 65 20 54 46 42 20 69 6e | 74 6f 20 61 20 72 65 73 |e TFB in|to a res|
|00001ad0| 65 74 20 73 74 61 74 65 | 20 2a 2f 0d 09 2f 2a 20 |et state| */../* |
|00001ae0| 30 78 42 37 20 61 70 70 | 61 72 65 6e 74 6c 79 20 |0xB7 app|arently |
|00001af0| 72 65 71 75 65 73 74 73 | 20 69 6e 74 65 72 6c 61 |requests| interla|
|00001b00| 63 65 20 63 6c 6f 63 6b | 20 6f 66 66 20 61 6e 64 |ce clock| off and|
|00001b10| 20 30 20 62 69 74 73 2f | 70 69 78 65 6c 20 2a 2f | 0 bits/|pixel */|
|00001b20| 0d 09 66 6f 72 28 69 3d | 31 35 3b 20 69 3e 3d 30 |..for(i=|15; i>=0|
|00001b30| 3b 20 69 2d 2d 29 20 7b | 0d 09 09 2a 64 73 74 50 |; i--) {|...*dstP|
|00001b40| 74 72 42 20 3d 20 7e 20 | 2a 73 72 63 50 74 72 42 |trB = ~ |*srcPtrB|
|00001b50| 2b 2b 3b 0d 09 09 64 73 | 74 50 74 72 42 20 2b 3d |++;...ds|tPtrB +=|
|00001b60| 20 34 3b 0d 09 7d 0d 09 | 72 65 74 75 72 6e 3b 0d | 4;..}..|return;.|
|00001b70| 7d 0d 0d 76 6f 69 64 20 | 53 79 6e 63 68 53 65 74 |}..void |SynchSet|
|00001b80| 44 65 70 74 68 54 46 42 | 28 69 6e 74 20 6d 61 73 |DepthTFB|(int mas|
|00001b90| 74 65 72 53 6c 6f 74 2c | 69 6e 74 20 73 6c 6f 74 |terSlot,|int slot|
|00001ba0| 2c 73 68 6f 72 74 20 62 | 69 74 73 29 0d 2f 2a 20 |,short b|its)./* |
|00001bb0| 73 65 74 73 20 75 70 20 | 74 68 65 20 76 69 64 65 |sets up |the vide|
|00001bc0| 6f 20 63 61 72 64 20 66 | 6f 72 20 74 68 65 20 64 |o card f|or the d|
|00001bd0| 65 73 69 72 65 64 20 6e | 75 6d 62 65 72 20 6f 66 |esired n|umber of|
|00001be0| 20 62 69 74 73 2f 70 69 | 78 65 6c 3a 20 31 2c 20 | bits/pi|xel: 1, |
|00001bf0| 32 2c 20 34 2c 20 6f 72 | 20 38 20 2a 2f 0d 7b 0d |2, 4, or| 8 */.{.|
|00001c00| 09 72 65 67 69 73 74 65 | 72 20 75 6e 73 69 67 6e |.registe|r unsign|
|00001c10| 65 64 20 63 68 61 72 20 | 2a 64 73 74 50 74 72 42 |ed char |*dstPtrB|
|00001c20| 2c 20 2a 73 72 63 50 74 | 72 42 3b 0d 09 72 65 67 |, *srcPt|rB;..reg|
|00001c30| 69 73 74 65 72 20 6c 6f | 6e 67 20 69 6e 74 20 69 |ister lo|ng int i|
|00001c40| 3b 0d 09 73 68 6f 72 74 | 20 69 6e 74 20 6c 6f 67 |;..short| int log|
|00001c50| 32 62 69 74 73 3b 09 09 | 2f 2a 20 3d 20 6c 6f 67 |2bits;..|/* = log|
|00001c60| 32 28 62 69 74 73 29 20 | 2a 2f 0d 0d 09 69 66 28 |2(bits) |*/...if(|
|00001c70| 21 54 46 42 49 6e 53 6c | 6f 74 28 73 6c 6f 74 29 |!TFBInSl|ot(slot)|
|00001c80| 29 7b 0d 09 09 70 72 69 | 6e 74 66 28 22 54 68 65 |){...pri|ntf("The|
|00001c90| 20 63 61 72 64 20 69 6e | 20 73 6c 6f 74 20 25 64 | card in| slot %d|
|00001ca0| 20 69 73 20 6e 6f 74 20 | 61 20 54 46 42 20 63 61 | is not |a TFB ca|
|00001cb0| 72 64 21 5c 6e 22 2c 73 | 6c 6f 74 29 3b 0d 09 09 |rd!\n",s|lot);...|
|00001cc0| 72 65 74 75 72 6e 3b 0d | 09 7d 0d 09 69 66 28 21 |return;.|.}..if(!|
|00001cd0| 54 46 42 49 6e 53 6c 6f | 74 28 6d 61 73 74 65 72 |TFBInSlo|t(master|
|00001ce0| 53 6c 6f 74 29 29 7b 0d | 09 09 70 72 69 6e 74 66 |Slot)){.|..printf|
|00001cf0| 28 22 54 68 65 20 63 61 | 72 64 20 69 6e 20 73 6c |("The ca|rd in sl|
|00001d00| 6f 74 20 25 64 20 69 73 | 20 6e 6f 74 20 61 20 54 |ot %d is| not a T|
|00001d10| 46 42 20 63 61 72 64 21 | 5c 6e 22 2c 6d 61 73 74 |FB card!|\n",mast|
|00001d20| 65 72 53 6c 6f 74 29 3b | 0d 09 09 72 65 74 75 72 |erSlot);|...retur|
|00001d30| 6e 3b 0d 09 7d 0d 09 69 | 66 28 62 69 74 73 21 3d |n;..}..i|f(bits!=|
|00001d40| 31 20 26 26 20 62 69 74 | 73 21 3d 32 20 26 26 20 |1 && bit|s!=2 && |
|00001d50| 62 69 74 73 21 3d 34 20 | 26 26 20 62 69 74 73 21 |bits!=4 |&& bits!|
|00001d60| 3d 38 29 7b 0d 09 09 70 | 72 69 6e 74 66 28 22 53 |=8){...p|rintf("S|
|00001d70| 79 6e 63 68 53 65 74 44 | 65 70 74 68 54 46 42 3a |ynchSetD|epthTFB:|
|00001d80| 20 25 64 20 62 69 74 73 | 2f 70 69 78 65 6c 20 69 | %d bits|/pixel i|
|00001d90| 6d 70 6f 73 73 69 62 6c | 65 20 66 6f 72 20 61 20 |mpossibl|e for a |
|00001da0| 54 46 42 20 63 61 72 64 | 21 5c 6e 22 2c 28 69 6e |TFB card|!\n",(in|
|00001db0| 74 29 62 69 74 73 29 3b | 0d 09 09 72 65 74 75 72 |t)bits);|...retur|
|00001dc0| 6e 3b 0d 09 7d 0d 09 6c | 6f 67 32 62 69 74 73 20 |n;..}..l|og2bits |
|00001dd0| 3d 20 30 3b 0d 09 77 68 | 69 6c 65 20 28 20 28 62 |= 0;..wh|ile ( (b|
|00001de0| 69 74 73 20 2f 3d 20 32 | 29 20 3e 20 30 20 29 20 |its /= 2|) > 0 ) |
|00001df0| 6c 6f 67 32 62 69 74 73 | 2b 2b 3b 0d 09 64 73 74 |log2bits|++;..dst|
|00001e00| 50 74 72 42 20 3d 20 28 | 43 41 52 44 42 41 53 45 |PtrB = (|CARDBASE|
|00001e10| 28 73 6c 6f 74 29 20 2b | 20 54 46 42 42 61 73 65 |(slot) +| TFBBase|
|00001e20| 29 3b 0d 09 73 72 63 50 | 74 72 42 20 3d 20 26 28 |);..srcP|trB = &(|
|00001e30| 54 46 42 52 65 67 69 73 | 74 65 72 56 61 6c 75 65 |TFBRegis|terValue|
|00001e40| 73 5b 6c 6f 67 32 62 69 | 74 73 5d 5b 30 5d 29 3b |s[log2bi|ts][0]);|
|00001e50| 09 0d 09 4e 65 77 46 69 | 65 6c 64 54 46 42 28 6d |...NewFi|eldTFB(m|
|00001e60| 61 73 74 65 72 53 6c 6f | 74 29 3b 09 09 2f 2a 20 |asterSlo|t);../* |
|00001e70| 77 61 69 74 20 66 6f 72 | 20 6d 61 73 74 65 72 53 |wait for| masterS|
|00001e80| 6c 6f 74 20 65 6e 64 20 | 6f 66 20 66 72 61 6d 65 |lot end |of frame|
|00001e90| 2a 2f 0d 09 2a 28 64 73 | 74 50 74 72 42 20 2b 20 |*/..*(ds|tPtrB + |
|00001ea0| 31 35 2a 34 29 20 3d 20 | 28 63 68 61 72 29 20 30 |15*4) = |(char) 0|
|00001eb0| 78 42 37 3b 09 2f 2a 20 | 50 72 65 6c 6f 61 64 20 |xB7;./* |Preload |
|00001ec0| 72 65 67 69 73 74 65 72 | 31 35 2e 20 50 75 74 20 |register|15. Put |
|00001ed0| 74 68 65 20 54 46 42 20 | 69 6e 74 6f 20 61 20 72 |the TFB |into a r|
|00001ee0| 65 73 65 74 20 73 74 61 | 74 65 20 2a 2f 0d 09 2f |eset sta|te */../|
|00001ef0| 2a 20 30 78 42 37 20 61 | 70 70 61 72 65 6e 74 6c |* 0xB7 a|pparentl|
|00001f00| 79 20 72 65 71 75 65 73 | 74 73 20 69 6e 74 65 72 |y reques|ts inter|
|00001f10| 6c 61 63 65 20 63 6c 6f | 63 6b 20 6f 66 66 20 61 |lace clo|ck off a|
|00001f20| 6e 64 20 30 20 62 69 74 | 73 2f 70 69 78 65 6c 20 |nd 0 bit|s/pixel |
|00001f30| 2a 2f 0d 09 66 6f 72 28 | 69 3d 31 35 3b 20 69 3e |*/..for(|i=15; i>|
|00001f40| 3d 30 3b 20 69 2d 2d 29 | 20 7b 0d 09 09 2a 64 73 |=0; i--)| {...*ds|
|00001f50| 74 50 74 72 42 20 3d 20 | 7e 20 2a 73 72 63 50 74 |tPtrB = |~ *srcPt|
|00001f60| 72 42 2b 2b 3b 0d 09 09 | 64 73 74 50 74 72 42 20 |rB++;...|dstPtrB |
|00001f70| 2b 3d 20 34 3b 0d 09 7d | 0d 09 72 65 74 75 72 6e |+= 4;..}|..return|
|00001f80| 3b 0d 7d 0d 0d 76 6f 69 | 64 20 53 79 6e 63 68 54 |;.}..voi|d SynchT|
|00001f90| 6f 4d 61 69 6e 44 65 76 | 69 63 65 54 46 42 28 47 |oMainDev|iceTFB(G|
|00001fa0| 44 48 61 6e 64 6c 65 20 | 64 65 76 69 63 65 29 0d |DHandle |device).|
|00001fb0| 7b 0d 09 53 79 6e 63 68 | 53 65 74 44 65 70 74 68 |{..Synch|SetDepth|
|00001fc0| 54 46 42 28 47 65 74 44 | 65 76 69 63 65 53 6c 6f |TFB(GetD|eviceSlo|
|00001fd0| 74 28 47 65 74 4d 61 69 | 6e 44 65 76 69 63 65 28 |t(GetMai|nDevice(|
|00001fe0| 29 29 2c 47 65 74 44 65 | 76 69 63 65 53 6c 6f 74 |)),GetDe|viceSlot|
|00001ff0| 28 64 65 76 69 63 65 29 | 2c 20 28 2a 2a 28 2a 2a |(device)|, (**(**|
|00002000| 64 65 76 69 63 65 29 2e | 67 64 50 4d 61 70 29 2e |device).|gdPMap).|
|00002010| 70 69 78 65 6c 53 69 7a | 65 29 3b 0d 7d 0d 0d 76 |pixelSiz|e);.}..v|
|00002020| 6f 69 64 20 48 61 6c 74 | 54 46 42 28 69 6e 74 20 |oid Halt|TFB(int |
|00002030| 73 6c 6f 74 29 0d 7b 0d | 09 72 65 67 69 73 74 65 |slot).{.|.registe|
|00002040| 72 20 75 6e 73 69 67 6e | 65 64 20 63 68 61 72 20 |r unsign|ed char |
|00002050| 2a 64 73 74 50 74 72 42 | 3b 0d 0d 09 69 66 28 21 |*dstPtrB|;...if(!|
|00002060| 54 46 42 49 6e 53 6c 6f | 74 28 73 6c 6f 74 29 29 |TFBInSlo|t(slot))|
|00002070| 7b 0d 09 09 70 72 69 6e | 74 66 28 22 54 68 65 20 |{...prin|tf("The |
|00002080| 63 61 72 64 20 69 6e 20 | 73 6c 6f 74 20 25 64 20 |card in |slot %d |
|00002090| 69 73 20 6e 6f 74 20 61 | 20 54 46 42 20 63 61 72 |is not a| TFB car|
|000020a0| 64 21 5c 6e 22 2c 73 6c | 6f 74 29 3b 0d 09 09 72 |d!\n",sl|ot);...r|
|000020b0| 65 74 75 72 6e 3b 0d 09 | 7d 0d 09 64 73 74 50 74 |eturn;..|}..dstPt|
|000020c0| 72 42 20 3d 20 28 43 41 | 52 44 42 41 53 45 28 73 |rB = (CA|RDBASE(s|
|000020d0| 6c 6f 74 29 20 2b 20 54 | 46 42 42 61 73 65 29 3b |lot) + T|FBBase);|
|000020e0| 0d 09 4e 65 77 46 69 65 | 6c 64 54 46 42 28 73 6c |..NewFie|ldTFB(sl|
|000020f0| 6f 74 29 3b 0d 09 2a 28 | 64 73 74 50 74 72 42 20 |ot);..*(|dstPtrB |
|00002100| 2b 20 31 35 2a 34 29 20 | 3d 20 28 63 68 61 72 29 |+ 15*4) |= (char)|
|00002110| 20 30 78 42 37 3b 09 2f | 2a 20 50 72 65 6c 6f 61 | 0xB7;./|* Preloa|
|00002120| 64 20 72 65 67 69 73 74 | 65 72 31 35 2e 20 50 75 |d regist|er15. Pu|
|00002130| 74 20 74 68 65 20 54 46 | 42 20 69 6e 74 6f 20 61 |t the TF|B into a|
|00002140| 20 72 65 73 65 74 20 73 | 74 61 74 65 20 2a 2f 0d | reset s|tate */.|
|00002150| 09 2f 2a 20 30 78 42 37 | 20 61 70 70 61 72 65 6e |./* 0xB7| apparen|
|00002160| 74 6c 79 20 72 65 71 75 | 65 73 74 73 20 69 6e 74 |tly requ|ests int|
|00002170| 65 72 6c 61 63 65 20 63 | 6c 6f 63 6b 20 6f 66 66 |erlace c|lock off|
|00002180| 20 61 6e 64 20 30 20 62 | 69 74 73 2f 70 69 78 65 | and 0 b|its/pixe|
|00002190| 6c 20 2a 2f 0d 7d 0d 0d | 76 6f 69 64 20 52 65 73 |l */.}..|void Res|
|000021a0| 74 61 72 74 54 46 42 28 | 69 6e 74 20 73 6c 6f 74 |tartTFB(|int slot|
|000021b0| 2c 73 68 6f 72 74 20 62 | 69 74 73 29 0d 7b 0d 09 |,short b|its).{..|
|000021c0| 72 65 67 69 73 74 65 72 | 20 75 6e 73 69 67 6e 65 |register| unsigne|
|000021d0| 64 20 63 68 61 72 20 2a | 64 73 74 50 74 72 42 2c |d char *|dstPtrB,|
|000021e0| 20 2a 73 72 63 50 74 72 | 42 3b 0d 09 72 65 67 69 | *srcPtr|B;..regi|
|000021f0| 73 74 65 72 20 6c 6f 6e | 67 20 69 6e 74 20 69 3b |ster lon|g int i;|
|00002200| 0d 09 73 68 6f 72 74 20 | 69 6e 74 20 6c 6f 67 32 |..short |int log2|
|00002210| 62 69 74 73 3b 09 09 2f | 2a 20 3d 20 6c 6f 67 32 |bits;../|* = log2|
|00002220| 28 62 69 74 73 29 20 2a | 2f 0d 0d 09 69 66 28 21 |(bits) *|/...if(!|
|00002230| 54 46 42 49 6e 53 6c 6f | 74 28 73 6c 6f 74 29 29 |TFBInSlo|t(slot))|
|00002240| 7b 0d 09 09 70 72 69 6e | 74 66 28 22 54 68 65 20 |{...prin|tf("The |
|00002250| 63 61 72 64 20 69 6e 20 | 73 6c 6f 74 20 25 64 20 |card in |slot %d |
|00002260| 69 73 20 6e 6f 74 20 61 | 20 54 46 42 20 63 61 72 |is not a| TFB car|
|00002270| 64 21 5c 6e 22 2c 73 6c | 6f 74 29 3b 0d 09 09 72 |d!\n",sl|ot);...r|
|00002280| 65 74 75 72 6e 3b 0d 09 | 7d 0d 09 69 66 28 62 69 |eturn;..|}..if(bi|
|00002290| 74 73 20 3e 20 38 29 20 | 72 65 74 75 72 6e 3b 0d |ts > 8) |return;.|
|000022a0| 09 6c 6f 67 32 62 69 74 | 73 20 3d 20 30 3b 0d 09 |.log2bit|s = 0;..|
|000022b0| 77 68 69 6c 65 20 28 20 | 28 62 69 74 73 20 2f 3d |while ( |(bits /=|
|000022c0| 20 32 29 20 3e 20 30 20 | 29 20 6c 6f 67 32 62 69 | 2) > 0 |) log2bi|
|000022d0| 74 73 2b 2b 3b 0d 09 64 | 73 74 50 74 72 42 20 3d |ts++;..d|stPtrB =|
|000022e0| 20 28 43 41 52 44 42 41 | 53 45 28 73 6c 6f 74 29 | (CARDBA|SE(slot)|
|000022f0| 20 2b 20 54 46 42 42 61 | 73 65 29 3b 0d 09 73 72 | + TFBBa|se);..sr|
|00002300| 63 50 74 72 42 20 3d 20 | 26 28 54 46 42 52 65 67 |cPtrB = |&(TFBReg|
|00002310| 69 73 74 65 72 56 61 6c | 75 65 73 5b 6c 6f 67 32 |isterVal|ues[log2|
|00002320| 62 69 74 73 5d 5b 30 5d | 29 3b 09 0d 09 2a 28 64 |bits][0]|);...*(d|
|00002330| 73 74 50 74 72 42 20 2b | 20 31 35 2a 34 29 20 3d |stPtrB +| 15*4) =|
|00002340| 20 28 63 68 61 72 29 20 | 30 78 42 37 3b 09 2f 2a | (char) |0xB7;./*|
|00002350| 20 50 72 65 6c 6f 61 64 | 20 72 65 67 69 73 74 65 | Preload| registe|
|00002360| 72 31 35 2e 20 50 75 74 | 20 74 68 65 20 54 46 42 |r15. Put| the TFB|
|00002370| 20 69 6e 74 6f 20 61 20 | 72 65 73 65 74 20 73 74 | into a |reset st|
|00002380| 61 74 65 20 2a 2f 0d 09 | 2f 2a 20 30 78 42 37 20 |ate */..|/* 0xB7 |
|00002390| 61 70 70 61 72 65 6e 74 | 6c 79 20 72 65 71 75 65 |apparent|ly reque|
|000023a0| 73 74 73 20 69 6e 74 65 | 72 6c 61 63 65 20 63 6c |sts inte|rlace cl|
|000023b0| 6f 63 6b 20 6f 66 66 20 | 61 6e 64 20 30 20 62 69 |ock off |and 0 bi|
|000023c0| 74 73 2f 70 69 78 65 6c | 20 2a 2f 0d 09 66 6f 72 |ts/pixel| */..for|
|000023d0| 28 69 3d 31 35 3b 20 69 | 3e 3d 30 3b 20 69 2d 2d |(i=15; i|>=0; i--|
|000023e0| 29 20 7b 0d 09 09 2a 64 | 73 74 50 74 72 42 20 3d |) {...*d|stPtrB =|
|000023f0| 20 7e 20 2a 73 72 63 50 | 74 72 42 2b 2b 3b 0d 09 | ~ *srcP|trB++;..|
|00002400| 09 64 73 74 50 74 72 42 | 20 2b 3d 20 34 3b 0d 09 |.dstPtrB| += 4;..|
|00002410| 7d 0d 09 72 65 74 75 72 | 6e 3b 0d 7d 0d 0d 76 6f |}..retur|n;.}..vo|
|00002420| 69 64 20 48 61 6c 74 44 | 65 76 69 63 65 54 46 42 |id HaltD|eviceTFB|
|00002430| 28 47 44 48 61 6e 64 6c | 65 20 64 65 76 69 63 65 |(GDHandl|e device|
|00002440| 29 0d 7b 0d 09 48 61 6c | 74 54 46 42 28 47 65 74 |).{..Hal|tTFB(Get|
|00002450| 44 65 76 69 63 65 53 6c | 6f 74 28 64 65 76 69 63 |DeviceSl|ot(devic|
|00002460| 65 29 29 3b 0d 7d 0d 0d | 76 6f 69 64 20 52 65 73 |e));.}..|void Res|
|00002470| 74 61 72 74 44 65 76 69 | 63 65 54 46 42 28 47 44 |tartDevi|ceTFB(GD|
|00002480| 48 61 6e 64 6c 65 20 64 | 65 76 69 63 65 29 0d 7b |Handle d|evice).{|
|00002490| 0d 09 52 65 73 74 61 72 | 74 54 46 42 28 47 65 74 |..Restar|tTFB(Get|
|000024a0| 44 65 76 69 63 65 53 6c | 6f 74 28 64 65 76 69 63 |DeviceSl|ot(devic|
|000024b0| 65 29 2c 20 28 2a 2a 28 | 2a 2a 64 65 76 69 63 65 |e), (**(|**device|
|000024c0| 29 2e 67 64 50 4d 61 70 | 29 2e 70 69 78 65 6c 53 |).gdPMap|).pixelS|
|000024d0| 69 7a 65 29 3b 0d 7d 0d | 0d 76 6f 69 64 20 53 63 |ize);.}.|.void Sc|
|000024e0| 72 6f 6c 6c 54 46 42 28 | 69 6e 74 20 73 6c 6f 74 |rollTFB(|int slot|
|000024f0| 2c 73 68 6f 72 74 20 62 | 69 74 73 2c 6c 6f 6e 67 |,short b|its,long|
|00002500| 20 78 2c 6c 6f 6e 67 20 | 79 29 0d 7b 0d 09 72 65 | x,long |y).{..re|
|00002510| 67 69 73 74 65 72 20 75 | 6e 73 69 67 6e 65 64 20 |gister u|nsigned |
|00002520| 63 68 61 72 20 2a 73 72 | 63 50 74 72 42 3b 0d 09 |char *sr|cPtrB;..|
|00002530| 6c 6f 6e 67 20 69 6e 74 | 20 73 2c 20 52 6f 77 42 |long int| s, RowB|
|00002540| 79 74 65 73 3b 0d 0d 09 | 69 66 28 21 54 46 42 49 |ytes;...|if(!TFBI|
|00002550| 6e 53 6c 6f 74 28 73 6c | 6f 74 29 29 7b 0d 09 09 |nSlot(sl|ot)){...|
|00002560| 70 72 69 6e 74 66 28 22 | 54 68 65 20 63 61 72 64 |printf("|The card|
|00002570| 20 69 6e 20 73 6c 6f 74 | 20 25 64 20 69 73 20 6e | in slot| %d is n|
|00002580| 6f 74 20 61 20 54 46 42 | 20 63 61 72 64 21 5c 6e |ot a TFB| card!\n|
|00002590| 22 2c 73 6c 6f 74 29 3b | 0d 09 09 72 65 74 75 72 |",slot);|...retur|
|000025a0| 6e 3b 0d 09 7d 0d 09 52 | 6f 77 42 79 74 65 73 20 |n;..}..R|owBytes |
|000025b0| 3d 20 31 30 32 34 2a 62 | 69 74 73 2f 38 3b 0d 09 |= 1024*b|its/8;..|
|000025c0| 73 20 3d 20 33 32 20 2b | 20 78 20 2b 20 52 6f 77 |s = 32 +| x + Row|
|000025d0| 42 79 74 65 73 2a 79 3b | 0d 09 73 20 2f 3d 20 34 |Bytes*y;|..s /= 4|
|000025e0| 3b 09 09 09 2f 2a 20 55 | 6e 66 6f 72 74 75 6e 61 |;.../* U|nfortuna|
|000025f0| 74 65 6c 79 20 74 68 65 | 20 42 61 73 65 20 41 64 |tely the| Base Ad|
|00002600| 64 72 65 73 73 20 69 73 | 20 73 70 65 63 69 66 69 |dress is| specifi|
|00002610| 65 64 20 69 6e 20 34 20 | 62 79 74 65 20 77 6f 72 |ed in 4 |byte wor|
|00002620| 64 73 20 2a 2f 0d 09 73 | 72 63 50 74 72 42 20 3d |ds */..s|rcPtrB =|
|00002630| 20 43 41 52 44 42 41 53 | 45 28 73 6c 6f 74 29 20 | CARDBAS|E(slot) |
|00002640| 2b 20 54 46 42 42 61 73 | 65 3b 0d 09 2a 28 73 72 |+ TFBBas|e;..*(sr|
|00002650| 63 50 74 72 42 20 2b 20 | 33 2a 34 29 20 3d 20 7e |cPtrB + |3*4) = ~|
|00002660| 20 73 25 32 35 36 3b 0d | 09 73 20 2f 3d 20 32 35 | s%256;.|.s /= 25|
|00002670| 36 3b 0d 09 2a 28 73 72 | 63 50 74 72 42 20 2b 20 |6;..*(sr|cPtrB + |
|00002680| 32 2a 34 29 20 3d 20 7e | 20 73 25 32 35 36 3b 0d |2*4) = ~| s%256;.|
|00002690| 2f 2a 0d 09 73 20 2f 3d | 20 32 35 36 3b 0d 09 2a |/*..s /=| 256;..*|
|000026a0| 28 73 72 63 50 74 72 42 | 20 2b 20 31 35 2a 34 29 |(srcPtrB| + 15*4)|
|000026b0| 20 3d 20 7e 20 28 34 2a | 28 73 25 32 29 20 2b 20 | = ~ (4*|(s%2) + |
|000026c0| 54 46 42 52 65 67 69 73 | 74 65 72 56 61 6c 75 65 |TFBRegis|terValue|
|000026d0| 73 5b 33 5d 5b 31 35 5d | 29 3b 0d 2a 2f 0d 7d 0d |s[3][15]|);.*/.}.|
|000026e0| 0d 76 6f 69 64 20 50 61 | 6e 54 46 42 28 69 6e 74 |.void Pa|nTFB(int|
|000026f0| 20 73 6c 6f 74 2c 6c 6f | 6e 67 20 69 6e 74 20 78 | slot,lo|ng int x|
|00002700| 29 0d 2f 2a 0d 50 61 6e | 54 46 42 28 29 20 70 61 |)./*.Pan|TFB() pa|
|00002710| 6e 73 20 74 68 65 20 64 | 69 73 70 6c 61 79 20 68 |ns the d|isplay h|
|00002720| 6f 72 69 7a 6f 6e 74 61 | 6c 6c 79 2e 0d 78 20 69 |orizonta|lly..x i|
|00002730| 73 20 74 68 65 20 64 65 | 73 69 72 65 64 20 73 74 |s the de|sired st|
|00002740| 61 72 74 69 6e 67 20 70 | 6f 69 6e 74 20 69 6e 20 |arting p|oint in |
|00002750| 6d 65 6d 6f 72 79 2c 20 | 69 6e 20 62 79 74 65 73 |memory, |in bytes|
|00002760| 2e 20 0d 46 6f 72 20 73 | 69 6d 70 6c 69 63 69 74 |. .For s|implicit|
|00002770| 79 20 49 20 61 73 73 75 | 6d 65 20 74 68 61 74 20 |y I assu|me that |
|00002780| 74 68 65 20 76 65 72 74 | 69 63 61 6c 20 73 63 72 |the vert|ical scr|
|00002790| 6f 6c 6c 20 69 73 20 7a | 65 72 6f 2e 0d 2a 2f 0d |oll is z|ero..*/.|
|000027a0| 7b 0d 09 72 65 67 69 73 | 74 65 72 20 75 6e 73 69 |{..regis|ter unsi|
|000027b0| 67 6e 65 64 20 63 68 61 | 72 20 2a 73 72 63 50 74 |gned cha|r *srcPt|
|000027c0| 72 42 3b 0d 0d 09 69 66 | 28 21 54 46 42 49 6e 53 |rB;...if|(!TFBInS|
|000027d0| 6c 6f 74 28 73 6c 6f 74 | 29 29 7b 0d 09 09 70 72 |lot(slot|)){...pr|
|000027e0| 69 6e 74 66 28 22 54 68 | 65 20 63 61 72 64 20 69 |intf("Th|e card i|
|000027f0| 6e 20 73 6c 6f 74 20 25 | 64 20 69 73 20 6e 6f 74 |n slot %|d is not|
|00002800| 20 61 20 54 46 42 20 63 | 61 72 64 21 5c 6e 22 2c | a TFB c|ard!\n",|
|00002810| 73 6c 6f 74 29 3b 0d 09 | 09 72 65 74 75 72 6e 3b |slot);..|.return;|
|00002820| 0d 09 7d 0d 09 78 20 2f | 3d 20 34 3b 09 09 09 2f |..}..x /|= 4;.../|
|00002830| 2a 20 55 6e 66 6f 72 74 | 75 6e 61 74 65 6c 79 20 |* Unfort|unately |
|00002840| 74 68 65 20 42 61 73 65 | 20 41 64 64 72 65 73 73 |the Base| Address|
|00002850| 20 69 73 20 73 70 65 63 | 69 66 69 65 64 20 69 6e | is spec|ified in|
|00002860| 20 34 20 62 79 74 65 20 | 77 6f 72 64 73 20 2a 2f | 4 byte |words */|
|00002870| 0d 09 78 20 2b 3d 20 38 | 3b 09 09 09 2f 2a 20 41 |..x += 8|;.../* A|
|00002880| 70 70 6c 65 27 73 20 6f | 72 69 67 69 6e 20 2a 2f |pple's o|rigin */|
|00002890| 0d 09 73 72 63 50 74 72 | 42 20 3d 20 43 41 52 44 |..srcPtr|B = CARD|
|000028a0| 42 41 53 45 28 73 6c 6f | 74 29 20 2b 20 54 46 42 |BASE(slo|t) + TFB|
|000028b0| 50 61 6e 3b 0d 09 2a 73 | 72 63 50 74 72 42 20 3d |Pan;..*s|rcPtrB =|
|000028c0| 20 7e 20 78 3b 0d 09 72 | 65 74 75 72 6e 3b 0d 7d | ~ x;..r|eturn;.}|
|000028d0| 0d 0d 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000028e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000028f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002900| 00 00 01 00 00 00 01 6e | 00 00 00 6e 00 00 00 3e |.......n|...n...>|
|00002910| 6e 65 72 61 6c 20 70 75 | 72 70 6f 73 65 20 76 69 |neral pu|rpose vi|
|00002920| 64 65 6f 20 72 6f 75 74 | 69 6e 65 73 20 62 61 73 |deo rout|ines bas|
|00002930| 0a 56 69 64 65 6f 54 46 | 42 2e 63 6f 02 00 00 00 |.VideoTF|B.co....|
|00002940| 54 45 58 54 43 57 49 45 | 01 00 00 78 06 00 00 00 |TEXTCWIE|...x....|
|00002950| 00 00 54 45 58 54 43 57 | 49 45 01 00 00 78 06 00 |..TEXTCW|IE...x..|
|00002960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002970| 00 00 9f 8f dd 2b 00 00 | 28 52 00 00 01 ac 73 74 |.....+..|(R....st|
|00002980| 69 63 73 20 49 20 72 65 | 63 65 69 76 65 64 20 66 |ics I re|ceived f|
|00002990| 72 6f 6d 20 54 6f 62 79 | 20 46 61 72 72 61 6e 64 |rom Toby| Farrand|
|000029a0| 2e 0d 31 30 2f 32 39 2f | 38 38 20 64 67 70 0d 2a |..10/29/|88 dgp.*|
|000029b0| 2f 0d 0d 0d 2f 2a 20 54 | 68 65 20 43 61 72 64 42 |/.../* T|he CardB|
|000029c0| 61 73 65 20 61 64 64 72 | 65 73 73 20 64 65 70 65 |ase addr|ess depe|
|000029d0| 6e 64 73 20 6f 6e 20 77 | 68 69 63 68 20 73 6c 6f |nds on w|hich slo|
|000029e0| 74 20 74 68 65 20 63 61 | 72 64 20 69 73 20 70 6c |t the ca|rd is pl|
|000029f0| 75 67 67 65 64 20 69 6e | 74 6f 20 2a 2f 0d 2f 2a |ugged in|to */./*|
|00002a00| 00 00 00 1e 00 3c 00 24 | 01 dd 02 3d 00 3c 00 24 |.....<.$|...=.<.$|
|00002a10| 01 dd 02 3d 00 00 23 b4 | 00 00 00 00 00 00 00 00 |...=..#.|........|
|00002a20| 00 00 00 00 00 48 00 09 | 4d 6f 6e 61 63 6f 00 00 |.....H..|Monaco..|
|00002a30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a40| 00 00 00 00 00 00 00 00 | 00 03 00 04 00 55 00 0e |........|.....U..|
|00002a50| 01 8c 02 7c 00 55 00 0e | 01 8c 02 7c aa 91 5e 01 |...|.U..|...|..^.|
|00002a60| 00 00 04 7f 00 00 04 7f | 00 00 03 0f 01 00 00 00 |........|........|
|00002a70| 01 00 00 00 01 6e 00 00 | 00 6e 00 00 00 3e 00 be |.....n..|.n...>..|
|00002a80| 2e 7c 12 bc 00 00 00 1c | 00 3e 00 00 4d 50 53 52 |.|......|.>..MPSR|
|00002a90| 00 01 00 0a 03 f0 ff ff | 00 00 00 00 00 00 00 00 |........|........|
|00002aa0| 03 ed ff ff 00 00 00 22 | 00 00 00 00 00 00 00 00 |......."|........|
|00002ab0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+